@use "../../variables.scss";

.AnalyzerFileTree--wrapper,
.ApplicationTree--wrapper {
  position: relative;

  .dirtree-wrapper {
    max-width: 260px;
    border-radius: 4px;
    background-color: var(--file-tree-color);

    &.fs-mode {
      max-width: 300px;
    }
  }

  .dirtree {
    padding: 6px 10px;
  }

  .file-contents-wrapper {
    margin-left: 12px;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid variables.$border-color;
    overflow: hidden;
  }

  .fullscreen-icon-wrapper {
    padding: 3px 4px;
    background-color: transparent;
    transition: background-color 0.2s;
    border-radius: 3px;
    cursor: pointer;
    position: absolute;
    z-index: 101;
    top: 5px;
    right: 5px;

    &:hover {
      .icon.u-fullscreenOpenIcon {
        background-position: -246px -258px;
      }
      .icon.u-fullscreenCloseIcon {
        background-position: -231px -257px;
      }
    }
  }

  .FileTree-wrapper input[type="checkbox"] {
    position: absolute;
    z-index: 1;
    opacity: 0;
    margin: 0;
    width: 100%;
    cursor: pointer;

    &:hover + label {
      color: #ffffff;
    }
  }
  .FileTree-wrapper ul {
    padding-top: 4px;
  }
  .FileTree-wrapper label,
  .FileTree-wrapper li {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.2s;
    font-size: 14px;
    position: relative;
    line-height: 18px;
    z-index: 2;
    padding: 6px 0 4px;

    & > div {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    &:hover {
      color: #ffffff;
      cursor: pointer;
    }
  }

  .FileTree-wrapper input[type="checkbox"]:checked + label,
  .FileTree-wrapper li.is-selected {
    font-weight: 700;
    color: #ffffff;

    &.is-file:after {
      position: absolute;
      content: "";
      display: block;
      right: -10px;
      width: 260px;
      height: 100%;
      top: 1px;
      z-index: -1;
      background-color: var(--file-tree-highlight-color);
    }
  }

  .dirtree-wrapper.fs-mode
    .FileTree-wrapper
    input[type="checkbox"]:checked
    + label,
  .dirtree-wrapper.fs-mode .FileTree-wrapper li.is-selected {
    &.is-file:after {
      width: 300px;
    }
  }

  .FileTree-wrapper label {
    &::before {
      margin-right: 5px;
      content: "";
      left: -1px;
      top: 0;
      position: relative;
      display: inline-block;
      pointer-events: none;
      background-image: url("../../../images/main_spritesheet.svg");
      background-repeat: no-repeat;
      background-size: initial;
      background-position: -124px 0;
      width: 4px;
      height: 7px;
      transition: transform 0.2s ease;
    }
  }
  .FileTree-wrapper input[type="checkbox"]:checked + label::before {
    transform: rotate(90deg);
  }

  .FileTree-wrapper ul {
    display: none;
  }

  .FileTree-wrapper input[type="checkbox"]:checked + label + ul,
  .FileTree-wrapper input[type="checkbox"]:checked + label:nth-of-type(n) + ul {
    /* use label:nth-of-type(n) to fix a bug on safari (<= 8.0.8) with multiple adjacent-sibling selectors*/
    display: block;
  }

  .AceEditor .active-highlight {
    background: #fffbdd;
    position: absolute;
  }
}

.redactor-pager {
  position: absolute;
  z-index: 10;
  border-radius: 40px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;

  div {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #4a4a4a;

    &.arrow-wrapper {
      position: relative;
      transition: background-color 0.2s;

      &::before {
        content: "";
        position: absolute;
        display: block;
        width: 1px;
        height: 12px;
        background-color: variables.$border-color;
        top: 10px;
      }

      &.can-scroll:hover {
        background-color: #f8f8f8;
        cursor: pointer;
        &::before {
          height: 100%;
          top: 0;
        }
      }

      &.prev {
        padding: 10px 10px 9px 15px;
        border-radius: 40px 0 0 40px;
        &::before {
          right: 0;
        }
      }
      &.next {
        padding: 10px 15px 9px 10px;
        border-radius: 0 40px 40px 0;
        &::before {
          left: 0;
        }
      }
    }
  }
}

.DisplayInstructionsModal--wrapper {
  .instruction-modal-number {
    font-size: 14px;
    font-weight: 600;
    padding: 3px 8px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 100%;
    line-height: 14px;
    margin-right: 10px;
    position: relative;
    top: 5px;
  }
}
